import React, { Component } from 'react'

// 高阶组件  == 装饰器有参数写法
// 使用装饰器中有传数据，则需要在回调用再次返回一个函数
/* export default (...args) => {
  console.log(args);
  return Cmp => {
    return class extends Component {
      render() {
        return <Cmp>几个参数</Cmp>
      }
    }
  }
} */

/* export default (...args) => Cmp => {
  return class extends Component {
    render() {
      return <Cmp>{args.join('####')}</Cmp>
    }
  }
} */

/* export default (...args) => Cmp => {
  return function () {
    return <Cmp>{args.join('####')}</Cmp>
  }
} */

// 高阶组件
/* export default (...args) => Cmp => () => {
  return <Cmp>{args.join('####')}</Cmp>
} */

export default (...args) => Cmp => () => <Cmp>{args.join('####')}</Cmp>